package top.buluoluo.ordersservice.entity;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import java.util.Map;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import jakarta.persistence.Column;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;
import top.buluoluo.ordersservice.enums.OrderDeliveryMethod;
import top.buluoluo.ordersservice.enums.OrderPaymentMethod;
import top.buluoluo.ordersservice.enums.OrderStatus;

/**
 * 订单主表(Orders)表实体类
 *
 * @author makejava
 * @since 2025-10-10 10:14:21
 */
@TableName(value = "orders", autoResultMap = true)
@Data
public class Orders {
    //订单ID
    private Long id;
    //订单号（唯一业务标识）
    private String orderNo;
    //用户ID
    private Long userId;
    //订单状态
    private OrderStatus status;
    //订单原始金额
    private BigDecimal originalAmount;
    //折扣率
    private BigDecimal discountRate;
    //订单最终金额
    private BigDecimal finalAmount;
    //支付方式
    private OrderPaymentMethod paymentMethod;
    //支付时间
    private Date paymentTime;
    //配送方式
    private OrderDeliveryMethod deliveryMethod;
    //配送地址（JSON结构）
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String, Object> deliveryAddress;
    //发票信息（JSON结构）
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String, Object> invoiceInfo;
    //订单备注
    private String remark;
    //创建时间
    private Date createdAt;
    //更新时间
    private Date updatedAt;
}

